TEXTAREA | NN 2 IE 3 DOM 1 | ||||
The TEXTAREA object reflects the TEXTAREA element and is used as a form control. This object is the primary way of getting a user to enter multiple lines of text for submission to the server. Note that the innerHTML property is not available on the Macintosh version of Internet Explorer 4. | |||||
HTML Equivalent<TEXTAREA> | |||||
Object Model Reference
|
accessKey | NN n/a IE 4 DOM 1 | ||
Read/Write | |||
A single character key that brings focus to the element. The browser
and operating system determine whether the user must press a modifier
key (e.g., | |||
Exampledocument.entryForm.myTextArea.accessKey = "n" | |||
Value Single alphanumeric (and punctuation) keyboard character. | |||
|
clientHeight, clientWidth | NN n/a IE 4 DOM n/a | ||
Read/Write | |||
According to Microsoft's developer documentation, these properties reflect the height and width (in pixels) of the element's content. | |||
Examplevar midHeight = document.forms[0].myTextArea.clientHeight/2 | |||
Value Integer pixel value. | |||
|
clientLeft, clientTop | NN n/a IE 4 DOM n/a | ||
Read-only | |||
According to Microsoft's developer documentation, these properties reflect the distance between the "true" left and top edges of the document area and the edges of the element. To get or set the pixel position of an element in the document, use the pixelLeft and pixelTop properties. | |||
Value A string value for a length in a variety of units or percentage. | |||
|
cols | NN n/a IE 4 DOM 1 | ||
Read/Write | |||
The width of the editable space of the TEXTAREA element. The value represents the number of monofont characters that are to be displayed within the width. When the font size can be influenced by style sheets, the actual width changes accordingly. | |||
Exampledocument.forms[0].comments.cols = 60 | |||
Value Any positive integer. | |||
|
dataFld | NN n/a IE 4 DOM n/a | ||
Read/Write | |||
Used with IE 4 data binding to associate a remote data source column name to a TEXTAREA object's value property. A DATASRC attribute must also be set for the element. Setting both the dataFld and dataSrc properties to empty strings breaks the binding between element and data source. | |||
Exampledocument.myForm.myTextArea.dataFld = "linkURL" | |||
Value Case-sensitive identifier of the data source column. | |||
|
dataSrc | NN n/a IE 4 DOM n/a | ||
Read/Write | |||
Used with IE 4 data binding to specify the name of the remote ODBC data source (such as an Oracle or SQL Server database) to be associated with the element. Content from the data source is specified via the DATAFLD attribute. Setting both the dataFld and dataSrc properties to empty strings breaks the binding between element and data source. | |||
Exampledocument.myForm.myTextArea.dataSrc = "#DBSRC3" | |||
Value Case-sensitive identifier of the data source. | |||
|
defaultValue | NN 2 IE 3 DOM 1 | ||
Read-only | |||
The default text for the TEXTAREA element, as established by the VALUE attribute. | |||
Examplevar txtAObj = document.forms[0].myTextArea if (txtAObj.value != txtAObj.defaultValue ) { ... } | |||
Value Any string value. | |||
|
disabled | NN n/a IE 4 DOM 1 | ||
Read/Write | |||
Whether the element is available for user interaction. When set to true, the element cannot receive focus or be modified by the user. It is also not submitted with the form. | |||
Exampledocument.forms[0].myTextArea.disabled = true | |||
Value Boolean value: true | false. | |||
|
form | NN 2 IE 3 DOM n/a | ||
Read-only | |||
Returns a reference to the FORM element that contains the current element (if any). This property is most often passed as a parameter for an event handler, using the this keyword to refer to the current form control. | |||
Example<TEXTAREA NAME="comment" onChange="doValidate(this.form)"> | |||
Value Object reference. | |||
|
name | NN 2 IE 3 DOM 1 | ||
Read/Write | |||
The identifier associated with the form control. The value of this property is submitted as one-half of the name/value pair when the form is submitted to the server. Names are hidden from user view, since control labels are assigned via other means, depending on the control type. Form control names may also be used by script references to the objects. The handling of carriage returns inside the element is governed by the setting of the wrap property. | |||
Exampledocument.orderForm.myTextArea.name = "Win32" | |||
Value Case-sensitive identifier that follows the rules of identifier naming: it may contain no whitespace, cannot begin with a numeral, and should avoid punctuation except for the underscore character. | |||
|
readOnly | NN n/a IE 4 DOM n/a | ||
Read-only | |||
Whether the form element can be edited on the page by the user. A form control whose readOnly property is true may still be modified by scripts, even though the user may not alter the content. | |||
Exampledocument.forms[0].myTextArea.readOnly = "true" | |||
Value Boolean value: true | false. | |||
|
rows | NN n/a IE 4 DOM 1 | ||
Read/Write | |||
The height of the TEXTAREA element based on the number of lines of text that are to be displayed without scrolling. The value represents the number of monofont character lines that are to be displayed within the height before the scrollbar becomes active. When the font size can be influenced by style sheets, the actual height changes accordingly. | |||
Exampledocument.forms[0].comments.rows = 6 | |||
Value Integer. | |||
|
scrollHeight, scrollWidth | NN n/a IE 4 DOM n/a | ||
Read-only | |||
The meaning of these two properties is ambiguous based on Microsoft's description and the way they're implemented in the Windows and Macintosh versions of Internet Explorer 4. My best guess is that these properties are intended to measure the height and width (in pixels) of the content of an element even when some of the content cannot be seen unless scrolled with scrollbars. The Macintosh version of the browser interprets this to mean the amount of the content that you can see at any one time. The important point is that for key elements, such as the BODY, the properties mean different things and can disrupt cross-platform operation. | |||
Examplevar midPoint = document.all.myTextArea.scrollHeight/2 | |||
Value Positive integer or zero. | |||
|
scrollLeft, scrollTop | NN n/a IE 4 DOM n/a | ||
Read/Write | |||
The distance in pixels between the actual left or top edge of the element's physical content and the left or top edge of the visible portion of the content. Setting these properties allows you to use scripts to adjust the scroll of content within a scrollable container, such as text in a TEXTAREA element or an entire document in the browser window or frame. When the content is not scrolled, both values are zero. Setting the scrollTop property to 15 scrolls the document upward by 15 pixels in the window; the scrollLeft property is unaffected unless explicitly changed. The property values change as the user adjusts the scrollbars. | |||
Exampledocument.all.myTextArea.scrollTop = 40 | |||
Value Positive integer or zero. | |||
|
tabIndex | NN n/a IE 4 DOM 1 | ||
Read/Write | |||
A number that indicates the sequence of this element within the tabbing order of all focusable elements in the document. Tabbing order follows a strict set of rules. Elements that have values other than zero assigned to their tabIndex properties are first in line when a user starts tabbing in a page. Focus starts with the element with the lowest tabIndex value and proceeds in order to the highest value, regardless of physical location on the page or in the document. If two elements have the same tabIndex values, the element that comes earlier in the document receives focus first. Next come all elements that either don't support the tabIndex property or have the value set to zero. These elements receive focus in the order in which they appear in the document. A value of -1 removes the element from tabbing order altogether. Note that the Macintosh user interface does not provide for giving focus to elements other than text and password INPUT fields. | |||
Exampledocument.forms[0].myTextArea.tabIndex = 6 | |||
Value Integer. | |||
|
type | NN 3 IE 4 DOM 1 | ||
Read-only | |||
Returns the type of form control element. The value is returned in all lowercase letters. It may be necessary to cycle through all form elements in search of specific types to do some processing on (e.g., emptying all form controls of type "text" while leaving other controls untouched). | |||
Exampleif (document.forms[0].elements[3].type == "textarea") { ... } | |||
Value Any of the following constants (as a string): button | checkbox | file | hidden | image | password | radio | reset | select-multiple | select-one | submit | text | textarea. | |||
|
value | NN 2 IE 3 DOM 1 | ||
Read/Write | |||
Current value associated with the form control that is submitted with the name/value pair for the element. All values are strings. | |||
Examplevar comment = document.forms[0].myTextArea.value | |||
Value String. | |||
|
wrap | NN n/a IE 4 DOM 1 | ||
Read/Write | |||
Whether the browser should wrap text in a TEXTAREA element and whether wrapped text should be submitted to the server with soft returns converted to hard carriage returns. A value of physical engages word wrapping and converts soft returns to CR-LF characters in the value submitted to the server. A value of virtual turns on word wrapping, but does not include the CR-LF characters in the text submitted with the form. A value of off turns word wrapping off. The Win32 version of Internet Explorer 4 returns a value of soft when the WRAP attribute is set to virtual. | |||
Exampledocument.forms[0].comments.wrap = "wrap" | |||
Value One of the constant values (as a string): physical | off | virtual. | |||
|
blur( ) | NN 2 IE 3 DOM n/a |
Removes focus from the current element and fires an onBlur event (in IE). No other element necessarily receives focus as a result. | |
Returned Value None. | |
Parameters None. |
createTextRange( ) | NN n/a IE 4 DOM n/a |
Creates a TextRange object from the content of the TEXTAREA object. See the TextRange object for details. | |
Returned Value TextRange object. |
focus( ) | NN 2 IE 3 DOM n/a |
Gives focus to the current element and fires the onFocus event (in IE). If another element had focus at the time, it receives an onBlur event. | |
Returned Value None. | |
Parameters None. |
handleEvent( ) | NN 4 IE n/a DOM n/a | ||
handleEvent(event) Instructs the object to accept and process the event whose specifications are passed as the parameter to the method. The object must have an event handler for the event type to process the event. | |||
Returned Value None. | |||
Parameters
|
select( ) | NN 2 IE 3 DOM n/a |
Selects all the text displayed in the form element. | |
Returned Value None. | |
Parameters None. |